<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/5/4
 * Time: 16:38
 */
class SimpleHtmlDomTest extends  PHPUnit_Framework_TestCase
{
    public function testBase()
    {
        $book = new BookSpider\Spider;
        $html = $book->fileGetHtml('http://www.23wx.com/html/62/62925/');
        return $html;
    }

    /**
     * @depends testBase
     */
    public function testCategory($object)
    {
        $result = $object->find('td.L a');
        $this->assertTrue(count($result)>10, 'get category failed');
        $this->assertNotEmpty($result[0]->plaintext);
        $this->assertNotEmpty($result[0]->href);
    }
}